package com.leyou.common.bean;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author zqq
 * @ClassName PageResult
 * @Description：分页工具类
 * @date 2020/2/23-17:48
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PageResult<T> {
    /** 总条数 */
    @ApiModelProperty(value = "总条数", name = "total")
    private Long total;

    /** 总页数 */
    @ApiModelProperty(value = "总页数", name = "totalPage")
    private int totalPage;

    /** 当前页数据 */
    @ApiModelProperty(value = "当前页数据", name = "items")
    private List<T> items;

    public PageResult(Long total, List<T> items) {
        this.total = total;
        this.items = items;
    }
}
